package com.aibaixun.common.enums;

import com.aibaixun.common.utils.StringUtils;
import lombok.Getter;

/**
 * dicm平台设备类型
 * @author zhangyh
 * @create 2023-09-14
 **/
@Getter
public enum DicmDeviceTypeEnum {
    DEVICE_TYPE_1(1, "高压配电"),
    DEVICE_TYPE_2(2, "低压交流配电"),
    DEVICE_TYPE_3(3, "变压器"),
    DEVICE_TYPE_4(4, "低压直流配电"),
    DEVICE_TYPE_5(5, "发电机组"),
    DEVICE_TYPE_6(6, "开关电源"),
    DEVICE_TYPE_7(7, "铅酸电池"),
    DEVICE_TYPE_8(8, "UPS设备"),
    DEVICE_TYPE_9(9, "UPS配电"),
    DEVICE_TYPE_11(11, "机房专用空调"),
    DEVICE_TYPE_12(12, "中央空调末端"),
    DEVICE_TYPE_13(13, "中央空调主机"),
    DEVICE_TYPE_14(14, "变换设备"),
    DEVICE_TYPE_15(15, "普通空调"),
    DEVICE_TYPE_16(16, "极早期烟感"),
    DEVICE_TYPE_17(17, "机房环境（温湿度传感器）"),
    DEVICE_TYPE_18(18, "电池恒温箱"),
    DEVICE_TYPE_68(68, "锂电池"),
    DEVICE_TYPE_69(69, "恒湿机"),
    DEVICE_TYPE_76(76, "动环监控"),
    DEVICE_TYPE_77(77, "智能通风换热"),
    DEVICE_TYPE_78(78, "风光设备"),
    DEVICE_TYPE_87(87, "高压直流电源"),
    DEVICE_TYPE_88(88, "高压直流电源配电"),
    DEVICE_TYPE_92(92, "智能电表"),
    DEVICE_TYPE_93(93, "智能门禁"),
    DEVICE_TYPE_94(94, "一体化能源柜"),
    DEVICE_TYPE_95(95, "户外小型一体化电源"),
    DEVICE_TYPE_96(96, "交流母线配电"),
    DEVICE_TYPE_666(666, "海康视频"),
    DEVICE_TYPE_770(770,"冷源设备"),


    DEVICE_TYPE_OTHER(0, "其他"),

    ;

    private final Integer code;
    private final String name;

    DicmDeviceTypeEnum(Integer code, String name)
    {
        this.code = code;
        this.name = name;
    }

    public static DicmDeviceTypeEnum getDeviceType(int code) {
        for (DicmDeviceTypeEnum value : values()) {
            if (code == value.getCode()) {
                return value;
            }
        }
        return DEVICE_TYPE_OTHER;
    }
}
